//
//  VistorView.swift
//  SwiftWB
//
//  Created by 远成物流 on 2017/6/23.
//
//

import UIKit

class VistorView: UIView {
    // MARK:- 提供快速通过xib创建的类方法
    class func vistowView() ->  VistorView{
        return Bundle.main.loadNibNamed("VistorView", owner: nil, options: nil)?.first as! VistorView
    }
    
    @IBOutlet weak var bgImg: UIImageView!
    @IBOutlet weak var homeImg: UIImageView!
    @IBOutlet weak var feedImg: UIImageView!
    @IBOutlet weak var tipLab: UILabel!
    @IBOutlet weak var registerBtn: UIButton!
    @IBOutlet weak var loginBtn: UIButton!
    
    ///设置view相关显示信息
    func setVistorViewInfo(iconName:String , title:String) {
        homeImg.image = UIImage(named: iconName)
        tipLab.text = title
        feedImg.isHidden = true
    }
    
    ///创建动画
    func addAnimation() {
        
        ///设置动画属性
        let rotation = CABasicAnimation(keyPath: "transform.rotation.z")
        rotation.fromValue = 0
        rotation.toValue = M_PI * 2
        rotation.repeatCount = MAXFLOAT
        rotation.duration = 5
        rotation.isRemovedOnCompletion = false
        
        feedImg.layer.add(rotation, forKey: nil)
    }
}
